package net.towee.client.widgets.upload.fileapi;

import com.google.gwt.core.client.JavaScriptObject;

public class FilesList {
	private final JavaScriptObject files;

	public FilesList(JavaScriptObject files){
		this.files = files;
	}
	
	public native int getLength() /*-{
		return this.@net.towee.client.widgets.upload.fileapi.FilesList::files.length;
	}-*/;
	
	public File getFile(int index){
		return new File( getNativeFile(index) );
	}
	
	public native JavaScriptObject getNativeFile(int index) /*-{
		return this.@net.towee.client.widgets.upload.fileapi.FilesList::files[index];
	}-*/;
}
